Use Mojo annotations instead of Javadoc tags#409
Use Mojo annotations instead of Javadoc tags#409Marcono1234 wants to merge 1 commit intowvengen:masterfrom
Conversation
| import org.apache.maven.plugin.MojoExecutionException; | ||
| import org.apache.maven.plugin.MojoFailureException; | ||
| import org.apache.maven.plugin.logging.Log; | ||
| import org.apache.maven.plugins.annotations.Component; |
There was a problem hiding this comment.
Note that the Component annotation is marked as deprecated. It seems the standard @Inject annotations should be used instead? See https://maven.apache.org/maven-jsr330.html#how-to-use-jsr-330-in-plugins
But I am not familiar with how this works with Maven (and whether the javax or Jakarta annotations can / should be used). Maybe for now this can keep using this deprecated annotation. Might already be an improvement over the previous Javadoc based variant.
| * | ||
| * @parameter default-value="${basedir}/proguard.conf" | ||
| */ | ||
| @Parameter(defaultValue = "${project.basedir}/proguard.conf") |
There was a problem hiding this comment.
The previous ${basedir} value without the project. prefix is deprecated. See https://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Project_Model_Variables
or the prefix omitted entirely - these forms are now deprecated and should not be used
| * The Jar archiver. | ||
| * | ||
| * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="jar" | ||
| * @required |
There was a problem hiding this comment.
Not sure if there is still a way now to set this 'required'. Though maybe it had no effect before anyway?
| protected String seedFileName = "proguard_seeds.txt"; | ||
| @Parameter(defaultValue = "proguard_seed.txt") |
There was a problem hiding this comment.
There was also a bug here previously where the initial field value had an extra s after seed: proguard_seeds.txt
But I think the default-value had higher precedence anway, and overwrote the initial field value.
| <!-- Only needed at build time --> | ||
| <scope>provided</scope> |
There was a problem hiding this comment.
| <localRepositoryPath>${projects.build.directory}/local-repo</localRepositoryPath> | ||
| <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath> |
There was a problem hiding this comment.
Was a typo previously?
Resolves #399
I compared the resulting JAR files afterwards; there are some small differences:
plugin.xml&plugin-help.xml:<description>tags of parameters contain the value of Javadoc tags as plaintext instead of the Javadoc tag, e.g.Determines if {@link #attach} also ...becameDetermines if attach also ....Not sure if that is intended but maybe this is not a big problem (or not a problem at all). The documentation generated by
mvn siteseems to be unaffected.@parameter expression=...I replaced it with@Parameter(defaultValue = "${...}"). I think this should give the same behavior, see also the (old) Maven book.This also applies to some usage of
@parameter property=...; I think that previously had the desired effect, but to my understandingpropertyis rather intended to define a custom system property which users can use, as it is the case with the existingproguard.skipfor this plugin.plugin-help.xml:<type>seems to contain the type argument for parameterized types now, e.g. previously it contained justjava.util.List, now it isjava.util.List<String>.I have made some basic test and it seems to work fine, but if you have a local test setup it would be great if you could give it a try as well.
Currently in my test I cannot get the
<assembly>parameter of the plugin to work, but maybe I am using it incorrectly.